using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Utilities
{
    /// <summary>
    /// <para>Semivariogram Sensitivity</para>
    /// <para>This tool performs a sensitivity analysis on the predicted values and associated standard errors by changing the model's semivariogram parameters (the nugget, partial sill, and major/minor ranges) within a percentage of the original values. The tool takes a geostatistical model source in order to populate these initial values of the nugget, partial sill, and major/minor ranges. The tool's output is a table indicating which parameter values were used and what the resulting predicted and standard error values were. If there are large fluctuations in the output with small changes in the model's parameter values, then you cannot have much confidence in the output. On the other hand, if changes in the output are small, then you can be confident in the model's predictions and make decisions based on its output.</para>
    /// <para>此工具通过在原始值的百分比内更改模型的半变异函数参数（块、部分门槛和主要/次要范围）来对预测值和相关标准误差执行敏感度分析。该工具采用地统计模型源，以填充金块、部分门槛和主要/次要范围的这些初始值。该工具的输出是一个表格，指示使用了哪些参数值以及生成的预测误差值和标准误差值是什么。如果输出波动很大，而模型的参数值变化很小，则对输出没有太大信心。另一方面，如果输出的变化很小，那么您可以对模型的预测充满信心，并根据其输出做出决策。</para>
    /// </summary>    
    [DisplayName("Semivariogram Sensitivity")]
    public class GASemivariogramSensitivity : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GASemivariogramSensitivity()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_ga_model_source">
        /// <para>Input geostatistical model source</para>
        /// <para>The geostatistical model source to be analyzed.</para>
        /// <para>要分析的地统计模型源。</para>
        /// </param>
        /// <param name="_in_datasets">
        /// <para>Input dataset(s)</para>
        /// <para>The name of the input datasets and field names used in the creation of the output layer.</para>
        /// <para>用于创建输出图层的输入数据集的名称和字段名称。</para>
        /// </param>
        /// <param name="_in_locations">
        /// <para>Input point observation locations</para>
        /// <para>Point locations where the sensitivity analysis is performed.</para>
        /// <para>执行敏感度分析的点位置。</para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output table</para>
        /// <para>Table storing the sensitivity results.</para>
        /// <para>存储灵敏度结果的表。</para>
        /// </param>
        public GASemivariogramSensitivity(object _in_ga_model_source, object _in_datasets, object _in_locations, object _out_table)
        {
            this._in_ga_model_source = _in_ga_model_source;
            this._in_datasets = _in_datasets;
            this._in_locations = _in_locations;
            this._out_table = _out_table;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Semivariogram Sensitivity";

        public override string CallName => "ga.GASemivariogramSensitivity";

        public override List<string> AcceptEnvironments => ["coincidentPoints", "randomGenerator", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_ga_model_source, _in_datasets, _in_locations, _nugget_span_percents, _nugget_calc_times, _partialsill_span_percents, _partialsill_calc_times, _range_span_percents, _range_calc_times, _minrange_span_percents, _minrange_calc_times, _out_table];

        /// <summary>
        /// <para>Input geostatistical model source</para>
        /// <para>The geostatistical model source to be analyzed.</para>
        /// <para>要分析的地统计模型源。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input geostatistical model source")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_ga_model_source { get; set; }


        /// <summary>
        /// <para>Input dataset(s)</para>
        /// <para>The name of the input datasets and field names used in the creation of the output layer.</para>
        /// <para>用于创建输出图层的输入数据集的名称和字段名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input dataset(s)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_datasets { get; set; }


        /// <summary>
        /// <para>Input point observation locations</para>
        /// <para>Point locations where the sensitivity analysis is performed.</para>
        /// <para>执行敏感度分析的点位置。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point observation locations")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_locations { get; set; }


        /// <summary>
        /// <para>Nugget span (% of model value)</para>
        /// <para>The percentage subtracted and added to the Nugget parameter to create a range for a subsequent random Nugget parameter selection.</para>
        /// <para>将百分比减去并添加到 Nugget 参数中，以便为后续的随机 Nugget 参数选择创建一个范围。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Nugget span (% of model value)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _nugget_span_percents { get; set; } = 10;


        /// <summary>
        /// <para>Number of calculations for Nugget</para>
        /// <para>Number of random Nugget values randomly sampled from the Nugget span.</para>
        /// <para>从 Nugget 跨度随机抽样的随机 Nugget 值的数量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of calculations for Nugget")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _nugget_calc_times { get; set; } = 3;


        /// <summary>
        /// <para>Partial Sill span (% of model value)</para>
        /// <para>Percentage subtracted from and added to the Partial Sill parameter to create a range for a random Partial Sill selection.</para>
        /// <para>从“部分门槛”参数中减去并添加到“部分门槛”参数的百分比，以创建随机“部分门槛”选择的范围。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Partial Sill span (% of model value)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _partialsill_span_percents { get; set; } = 0;


        /// <summary>
        /// <para>Number of calculations for Partial Sill</para>
        /// <para>Number of Partial Sill values randomly sampled from the Partial Sill span.</para>
        /// <para>从“部分门槛”跨度中随机采样的“偏门槛”值的数量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of calculations for Partial Sill")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _partialsill_calc_times { get; set; } = 0;


        /// <summary>
        /// <para>Major Range span (% of model value)</para>
        /// <para>Percentage subtracted and added to the Major Range parameter to create a range for a random Major Range selection.</para>
        /// <para>将百分比减去并添加到“主要范围”参数中，以便为随机“主要范围”选择创建范围。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Major Range span (% of model value)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _range_span_percents { get; set; } = 0;


        /// <summary>
        /// <para>Number of calculations for Major Range</para>
        /// <para>Number of Major Range values randomly sampled from the Major Range span.</para>
        /// <para>从主要范围中随机抽样的主要范围值的数量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of calculations for Major Range")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _range_calc_times { get; set; } = 0;


        /// <summary>
        /// <para>Minor Range span (% of model value)</para>
        /// <para>Percentage subtracted and added to the Minor Range parameter to create a range for a random Minor Range selection.</para>
        /// <para>将百分比减去并添加到“次要范围”参数中，以创建随机“次要范围”选择的范围。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minor Range span (% of model value)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _minrange_span_percents { get; set; } = 0;


        /// <summary>
        /// <para>Number of calculations for Minor Range</para>
        /// <para><xdoc>
        ///   <para>Number of Minor Range values randomly sampled from the Minor Range span.</para>
        ///   <para>If Anisotropy has been set in the input geostatistical model source, a value is required.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>从次要范围范围中随机采样的次要范围值的数量。</para>
        ///   <para>如果在输入地统计模型源中设置了各向异性，则需要一个值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of calculations for Minor Range")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _minrange_calc_times { get; set; } = 0;


        /// <summary>
        /// <para>Output table</para>
        /// <para>Table storing the sensitivity results.</para>
        /// <para>存储灵敏度结果的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        public GASemivariogramSensitivity SetEnv(object coincidentPoints = null, object randomGenerator = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(coincidentPoints: coincidentPoints, randomGenerator: randomGenerator, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}